package matching;

public class item {

	private int id, howlong;
	private String togive, totake, isoffer, contact;
	
	public item(int idT, String togiveT, String totakeT, int howlongT, String isofferT, String _contact)
	{
		id = idT;
		togive = togiveT;
		totake = totakeT;
		howlong = howlongT;
		isoffer = isofferT;
		contact = _contact;
	}
	
	public int getId()
	{
		return id;
	}
	
	public String getToGive()
	{
		return togive;
	}
	
	public String getToTake()
	{
		return totake;
	}
	
	public int getHowLong()
	{
		return howlong;
	}
	
	public String getIsOffer()
	{
		return isoffer;
	}
	
	public String getContact()
	{
		return contact;
	}
	
	public String toString()
	{
		String s = "ID="+id + " \n togive=" + togive + "\n totake=" + totake + "\n howlong= " + howlong + "\n isoffer " + isoffer;
		return s;
	}
	
	
	public boolean isExactMatch(item i)
	{
		if(i.getToTake().equalsIgnoreCase(togive))
			return true;
		if(i.getToGive().equalsIgnoreCase(totake))
			return true;
		
		return false;
	}
}
